

<template>
	<view style="position: relative;">
		<image :src="imageUrl" mode="widthFix" style="width: 750rpx;" @load="handleImageLoad" v-if="imageUrl" />
	    <!-- <view class="fuwuxiang" @click="gotofuwu()" v-if="id==='6'">服务详情</view> -->
		<view v-if="isWechat"
			style="position: fixed;bottom: 0;width: 750rpx;height: 150rpx;background-color: white;display: flex;justify-content: center;align-items: center;z-index: 9999999;">
			<view
				style="height: 80rpx;width: 400rpx;margin: 0 auto;background-color: rgb(9, 103, 252);color:white;display: flex;justify-content: center;align-items: center;font-size: 40rpx;border-radius: 100rpx;"
				@click="tijiao()"><view style="text-align: center;">咨询客服</view></view>
		</view>
	</view>
	
</template>

<script setup>
	import {
		onLoad,
		onShow
	} from '@dcloudio/uni-app';
	import {
		ref,
		onMounted,

	} from 'vue';

	// 定义响应式变量  
	const imageUrl = ref(''); // 图片地址  
	const imageLoaded = ref(false); // 图片加载状态  
    const isWechat = ref(false)
	// 使用 onMounted 钩子设置图片的 URL  
	const id = ref("")
	onLoad((options) => {

		id.value = options.id
		console.log(options.id, "1", imageUrl)
		if (id.value === "1") {
			//全球找药协助
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E5%AE%88%E6%9C%9B%E6%85%88%E7%88%B1%E7%89%88ui%E6%B5%B7%E6%8A%A5%E5%9B%BE/%E5%85%A8%E7%90%83%E6%89%BE%E8%8D%AF%E5%8D%8F%E5%8A%A9-1734586446.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1734586387%3B4888186447&q-key-time=1734586387%3B4888186447&q-header-list=host&q-url-param-list=&q-signature=d0595b1a786d73f1473a0cb12f603bd147a7eb21"
		} else if (id.value === "2") {
			//基础医疗权益金
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E5%AE%88%E6%9C%9B%E6%85%88%E7%88%B1%E7%89%88ui%E6%B5%B7%E6%8A%A5%E5%9B%BE/%E5%8C%BB%E7%96%97%E6%9D%83%E7%9B%8A%E9%87%91-1734586481.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1734586422%3B4888186482&q-key-time=1734586422%3B4888186482&q-header-list=host&q-url-param-list=&q-signature=4acc0587e806f60a523559ac84e1094e1c758079"
		} else if (id.value === "3") {
			//细胞存储健康管理服务
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E5%AE%88%E6%9C%9B%E6%85%88%E7%88%B1%E7%89%88ui%E6%B5%B7%E6%8A%A5%E5%9B%BE/%E7%BB%86%E8%83%9E%E5%AD%98%E5%82%A8%E5%81%A5%E5%BA%B7%E7%AE%A1%E7%90%86%E6%9C%8D%E5%8A%A1-1734586516.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1734586457%3B4888186517&q-key-time=1734586457%3B4888186517&q-header-list=host&q-url-param-list=&q-signature=54b82720ab7c755fe7aaaf6a768fc8f48414e24e"
		} else if (id.value === "4") {
			//MDT多学科会诊协助
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E5%AE%88%E6%9C%9B%E6%85%88%E7%88%B1%E7%89%88ui%E6%B5%B7%E6%8A%A5%E5%9B%BE/MDT%E5%A4%9A%E5%AD%A6%E7%A7%91%E4%BC%9A%E8%AF%8A-1734586559.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1734586500%3B4888186560&q-key-time=1734586500%3B4888186560&q-header-list=host&q-url-param-list=&q-signature=6e1a6f3e90c778c64a6d9e446370d8457cba4081"
		} else if (id.value === "5") {
			//博鳌乐城先行区就医协助
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E5%AE%88%E6%9C%9B%E6%85%88%E7%88%B1%E7%89%88ui%E6%B5%B7%E6%8A%A5%E5%9B%BE/%E5%8D%9A%E9%B3%8C%E4%B9%90%E5%9F%8E%E5%85%88%E8%A1%8C%E5%8C%BA%E5%B0%B1%E5%8C%BB%E5%8D%8F%E5%8A%A9-1734586603.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1734586545%3B4888186605&q-key-time=1734586545%3B4888186605&q-header-list=host&q-url-param-list=&q-signature=d24761fccc8b37cfef57671af83870b3f2a14c4a"
		} else if (id.value === "6") {
			//基因检测优惠
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E5%AE%88%E6%9C%9B%E6%85%88%E7%88%B1%E7%89%88ui%E6%B5%B7%E6%8A%A5%E5%9B%BE/%E5%9F%BA%E5%9B%A0%E6%A3%80%E6%B5%8B%E4%BC%98%E6%83%A0-1734586630.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1734586571%3B4888186631&q-key-time=1734586571%3B4888186631&q-header-list=host&q-url-param-list=&q-signature=d5d1beb53122f64153e518b83847dbdd913200ec"
		} else if (id.value === "7") {
			//赴日就医协助
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E5%AE%88%E6%9C%9B%E6%85%88%E7%88%B1%E7%89%88ui%E6%B5%B7%E6%8A%A5%E5%9B%BE/%E8%B5%B4%E6%97%A5%E5%B0%B1%E5%8C%BB%E5%8D%8F%E5%8A%A9-1734586667.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1734586609%3B4888186669&q-key-time=1734586609%3B4888186669&q-header-list=host&q-url-param-list=&q-signature=404856c670bf5a7979d5e4d776aa1a58c9738a17"
		}else if(id.value === "8"){
			//博鳌乐城医疗先行区专享康养套餐优惠
			imageUrl.value = 
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E5%AE%88%E6%9C%9B%E6%85%88%E7%88%B1%E7%89%88ui%E6%B5%B7%E6%8A%A5%E5%9B%BE/%E5%8D%9A%E9%B3%8C%E4%B9%90%E5%9F%8E%E4%BC%98%E6%83%A0-1734586699.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1734586641%3B4888186701&q-key-time=1734586641%3B4888186701&q-header-list=host&q-url-param-list=&q-signature=cfdfe81d4ed18cc26f32bb0813bd046015e1a9af"
		}

	})
	onMounted(() => {
          ready()
	})
	const gotofuwu = () => {
		uni.navigateTo({
			url:"/pages/invite/serveritem"
		})
	}
	// 定义处理图片加载的方法  
	const handleImageLoad = () => {
		imageLoaded.value = true;
		// 修改加载状态为已加载  
		console.log('Image loaded successfully');
	};
	const goto = () => {
		uni.navigateTo({
			url: "/pages/invite/serveritem"
		})
	}
	const longPressHandler = () => {
        wx.scanCode({
              scanType: ['qrCode'],
              success: function(res) {
                console.log(res.result);
              }
            });
	}
    const tijiao = () =>{
     window.location.href = "https://work.weixin.qq.com/kfid/kfcca83d37fd4413968"
    }
    function ready() {
        if (window.__wxjs_environment === 'miniprogram') {
            console.log('在小程序内');
			isWechat.value = false
        } else {
            console.log('不在小程序内');
			isWechat.value = true
        }
    }
	
</script>

<style scoped>
	.fuwuxiang {
	  position: fixed;
	  right: 0rpx;
	  top: 10vh;
	  width: 70rpx;
	  background-color: rgb(76, 194, 255);
	  display: flex;
	  border-top-left-radius: 20rpx;
	  border-bottom-left-radius: 20rpx;
	  display: flex;
	  justify-content: center;
	  align-items: center;
	  text-align: center;
	  padding: 10rpx;
	  font-size: 30rpx;
	  border: 5rpx solid rgb(68, 122, 206);
	  font-weight: 1000;
	  color: rgb(31, 78, 120);
	  z-index: 999999;
	  color: rgb(68, 122, 206);
	  text-align: center;
	}

</style>